import { defineStore } from "pinia";


export const useAnswerStore = defineStore({
    id: 'answerStore',
    state: () => ({
        answersArr: <ProjectType.QuestionProps[]>[]
    }),
    actions: {
        setAnswerData(answersArr: ProjectType.QuestionProps[]) {
            // console.log('answersArr ==== ', answersArr);
            this.answersArr = [...answersArr]
        },
        clearAnswerData() {
            this.answersArr = []
        }
    },
    persist: {
        key: 'piniaAnswerStore', //存储名称
        storage: sessionStorage, // 存储方式
    }
})